package com.green.common.util;
/**
 * 当前登陆的User，线程绑定
 * @author Hou Peiqin
 *
 */
public class SessionPerson {
    @SuppressWarnings("rawtypes")
	private static final ThreadLocal currentPerson = new ThreadLocal();

    @SuppressWarnings("unchecked")
	public static <T>T get() {
        return (T) currentPerson.get();
    }

    @SuppressWarnings("unchecked")
	public static <T>  void set(T person) {
    	currentPerson.set(person);
    }
    
    public static void clear() {
    	currentPerson.remove();
    }
}
